<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
  <head>
    <th:block th:replace="~{/_include/header}" />
    <meta name="page-help" content="https://getrebuild.com/docs/admin/entity/" />
    <title>[[${bundle.L('基本信息')}]]</title>
    <link rel="stylesheet" type="text/css" th:href="@{/assets/css/meta-edit.css}" />
    <style>
      .custom-control-label .support-plat2 {
        margin-top: 1px;
      }
    </style>
  </head>
  <body>
    <div class="rb-wrapper rb-fixed-sidebar rb-collapsible-sidebar rb-collapsible-sidebar-hide-logo rb-aside rb-color-header" th:classappend="${sideCollapsedClazz}">
      <th:block th:replace="~{/_include/nav-top}" />
      <th:block th:replace="~{/_include/nav-left-admin(active='entities')}" />
      <div class="rb-content">
        <aside class="page-aside">
          <div class="rb-scroller-aside rb-scroller">
            <div class="aside-content">
              <div class="content">
                <div class="aside-header dropdown">
                  <span class="title">[[${entityLabel}]]</span>
                  <p class="description">[[${comments}]]</p>
                </div>
              </div>
              <div class="aside-nav collapse">
                <ul class="nav">
                  <li class="active"><a href="base">[[${bundle.L('基本信息')}]]</a></li>
                  <li><a href="form-design">[[${bundle.L('表单设计')}]]</a></li>
                  <li><a href="fields">[[${bundle.L('字段管理')}]]</a></li>
                  <li><a href="advanced">[[${bundle.L('高级配置')}]]</a></li>
                </ul>
              </div>
            </div>
          </div>
        </aside>
        <div class="page-head">
          <div class="page-head-title">[[${bundle.L('基本信息')}]]</div>
        </div>
        <div class="main-content container-fluid pt-1">
          <ul th:if="${detailEntity != null}" class="nav nav-tabs nav-tabs-classic">
            <li th:class="nav-item" th:data-name="${mainEntity}"><a th:href="|../${mainEntity}/base|" class="nav-link">[[${bundle.L('主实体')}]]</a></li>
            <li th:class="nav-item" th:data-name="${detailEntity}">
              <a th:href="|../${detailEntity}/base|" class="nav-link J_for-details">[[${bundle.L('明细实体')}]]</a>
              <div th:if="${detailEntities.length > 1}" class="dropdown-menu J_details">
                <a th:each="e : ${detailEntities}" th:href="|../${e[1]}/base|" th:data-name="${e[1]}" class="dropdown-item"><i th:class="|icon zmdi zmdi-${e[3]}|"></i> [[${e[2]}]]</a>
              </div>
            </li>
          </ul>
          <div class="card mb-0">
            <div class="card-body pt-4">
              <form class="simple">
                <div class="form-group row">
                  <label class="col-md-12 col-xl-3 col-lg-4 col-form-label text-lg-right">[[${bundle.L('图标')}]]</label>
                  <div class="col-md-12 col-xl-6 col-lg-8">
                    <a id="entityIcon" th:data-o="${icon}" title="更换图标"><i th:class="|icon zmdi zmdi-${icon}|"></i></a>
                  </div>
                </div>
                <div class="form-group row">
                  <label class="col-md-12 col-xl-3 col-lg-4 col-form-label text-lg-right">[[${bundle.L('实体名称')}]]</label>
                  <div class="col-md-12 col-xl-6 col-lg-8">
                    <input class="form-control form-control-sm" type="text" id="entityLabel" maxlength="40" th:value="${entityLabel}" th:data-o="${entityLabel}" />
                  </div>
                </div>
                <div class="form-group row">
                  <label class="col-md-12 col-xl-3 col-lg-4 col-form-label text-lg-right">[[${bundle.L('内部标识')}]]</label>
                  <div class="col-md-12 col-xl-6 col-lg-8">
                    <input class="form-control form-control-sm" type="text" readonly id="entityName" th:value="${entityName + ' (' + entityCode + ')'}" />
                  </div>
                </div>
                <div class="form-group row">
                  <label class="col-md-12 col-xl-3 col-lg-4 col-form-label text-lg-right">[[${bundle.L('名称字段')}]]</label>
                  <div class="col-md-12 col-xl-6 col-lg-8">
                    <select class="form-control form-control-sm" id="nameField" th:data-o="${nameField}"></select>
                    <p class="form-text mb-0">[[${bundle.L('名称字段应该清晰的体现记录本身，如客户中的客户名称')}]]</p>
                  </div>
                </div>
                <div class="form-group row">
                  <label class="col-md-12 col-xl-3 col-lg-4 col-form-label text-lg-right">[[${bundle.L('快速查询字段')}]]</label>
                  <div class="col-md-12 col-xl-6 col-lg-8">
                    <select class="form-control form-control-sm" id="quickFields"></select>
                    <p class="form-text mb-0">[[${bundle.L('用于列表、表单引用字段等处的快速查询')}]]</p>
                  </div>
                </div>
                <div class="form-group row">
                  <label class="col-md-12 col-xl-3 col-lg-4 col-form-label text-lg-right">[[${bundle.L('备注')}]]</label>
                  <div class="col-md-12 col-xl-6 col-lg-8">
                    <textarea class="form-control form-control-sm row2x" id="comments" th:data-o="${comments}" th:placeholder="${bundle.L('(选填)')}">[[${comments}]]</textarea>
                  </div>
                </div>
                <div class="form-group row">
                  <label class="col-md-12 col-xl-3 col-lg-4 col-form-label text-lg-right">[[${bundle.L('标签')}]]</label>
                  <div class="col-md-12 col-xl-6 col-lg-8">
                    <select class="form-control form-control-sm" id="tags"></select>
                  </div>
                </div>
                <div class="form-group row">
                  <label class="col-md-12 col-xl-3 col-lg-4 col-form-label text-lg-right pt-1"></label>
                  <div class="col-md-12 col-xl-6 col-lg-8">
                    <a href="javascript:;" class="adv-options-btn">[[${bundle.L('展开高级选项')}]] <i class="mdi mdi-chevron-double-down"></i> <sup class="rbv"></sup></a>
                    <div class="adv-options hide">
                      <div>
                        <label class="custom-control custom-control-sm custom-checkbox custom-control-inline">
                          <input class="custom-control-input" type="checkbox" id="disabledViewEditable" />
                          <span class="custom-control-label">[[${bundle.L('禁用详情页单字段编辑')}]]</span>
                        </label>
                      </div>
                      <th:block th:if="${currentEntity == mainEntity || detailEntity == null}">
                        <div class="mt-2">
                          <label class="custom-control custom-control-sm custom-checkbox custom-control-inline">
                            <input class="custom-control-input" type="checkbox" id="enableRecordMerger" />
                            <span class="custom-control-label">[[${bundle.L('启用记录合并功能')}]] <i class="support-plat2 mdi mdi-monitor" th:title="${bundle.L('支持 PC')}"></i></span>
                          </label>
                        </div>
                      </th:block>
                      <div class="mt-2">
                        <label class="custom-control custom-control-sm custom-checkbox custom-control-inline">
                          <input class="custom-control-input" type="checkbox" id="repeatFieldsCheckMode" />
                          <span class="custom-control-label">[[${bundle.L('“允许重复”检查全部字段')}]]</span>
                        </label>
                      </div>
                      <th:block th:if="${currentEntity == detailEntity}">
                        <div class="mt-2">
                          <label class="custom-control custom-control-sm custom-checkbox custom-control-inline">
                            <input class="custom-control-input" type="checkbox" id="detailsGlobalRepeat" />
                            <span class="custom-control-label">[[${bundle.L('“允许重复”检查全部数据')}]]</span>
                          </label>
                        </div>
                        <div class="mt-2">
                          <label class="custom-control custom-control-sm custom-checkbox custom-control-inline">
                            <input class="custom-control-input" type="checkbox" id="detailsNotEmpty" />
                            <span class="custom-control-label">[[${bundle.L('明细不允许为空')}]]</span>
                          </label>
                        </div>
                        <div class="mt-2">
                          <label class="custom-control custom-control-sm custom-checkbox custom-control-inline">
                            <input class="custom-control-input" type="checkbox" id="detailsShowAt2" />
                            <span class="custom-control-label">[[${bundle.L('明细显示在详情页下方')}]] <i class="support-plat2 mdi mdi-monitor" th:title="${bundle.L('支持 PC')}"></i></span>
                          </label>
                        </div>
                        <div class="mt-2">
                          <label class="custom-control custom-control-sm custom-checkbox custom-control-inline">
                            <input class="custom-control-input" type="checkbox" id="detailsCopiable" />
                            <span class="custom-control-label">[[${bundle.L('明细启用复制功能')}]] <i class="support-plat2 mdi mdi-monitor" th:title="${bundle.L('支持 PC')}"></i></span>
                          </label>
                        </div>
                      </th:block>
                    </div>
                  </div>
                </div>
                <div class="form-group row footer">
                  <div class="col-md-12 col-xl-6 col-lg-8 offset-xl-3 offset-lg-4">
                    <div class="J_action hide">
                      <button class="btn btn-primary J_save" type="button">[[${bundle.L('保存')}]]</button>
                    </div>
                    <div class="alert alert-warning alert-icon mb-0 hide">
                      <div class="icon"><span class="zmdi zmdi-alert-triangle"></span></div>
                      <div class="message">[[${bundle.L('系统内置，不允许修改')}]]</div>
                    </div>
                  </div>
                </div>
              </form>
            </div>
          </div>
        </div>
      </div>
    </div>
    <th:block th:replace="~{/_include/footer}" />
    <script>
      window.__PageConfig = {
        metaId: '[[${entityMetaId}]]',
        entity: '[[${entityName}]]',
        nameField: '[[${nameField}]]',
        extConfig: [(${entityExtConfig ?:'null'})],
      }
    </script>
    <script th:src="@{/assets/js/metadata/entity-edit.js}" type="text/babel"></script>
    <script th:src="@{/assets/js/metadata/entity-switch.js}" type="text/babel"></script>
  </body>
</html>
